package org.lanqiao.tjut.entity;

import java.util.Date;

public class GameScore implements Comparable<GameScore> {
	/**
	 * 玩家号码
	 */
	private Integer playerid;
	/**
	 * 玩家得分
	 */
	private Integer plascore;
	/**
	 * 游戏结果
	 */
	private String plaresult;
	/**
	 * 游戏编号
	 */
	private Integer gameid;
	/**
	 * 游戏轮数
	 */
	private Integer gameround;
	/**
	 * 游戏时间
	 */
	private Date gametime;

	public Integer getPlayerid() {
		return playerid;
	}

	public void setPlayerid(Integer playerid) {
		this.playerid = playerid;
	}

	public Integer getPlascore() {
		return plascore;
	}

	public void setPlascore(Integer plascore) {
		this.plascore = plascore;
	}

	public String getPlaresult() {
		return plaresult;
	}

	public void setPlaresult(String plaresult) {
		this.plaresult = plaresult;
	}

	public Integer getGameid() {
		return gameid;
	}

	public void setGameid(Integer gameid) {
		this.gameid = gameid;
	}

	public Integer getGameround() {
		return gameround;
	}

	public void setGameround(Integer gameround) {
		this.gameround = gameround;
	}

	public Date getGametime() {
		return gametime;
	}

	public void setGametime(Date gametime) {
		this.gametime = gametime;
	}

	@Override
	public String toString() {
		return "GameScore [playerid=" + playerid + ", plascore=" + plascore + ", plaresult=" + plaresult + ", gameid="
				+ gameid + ", gameround=" + gameround + ", gametime=" + gametime + "]";
	}

	// 因为要涉及到根据玩家分数选出赢家，所以此类继承Comparable接口，重写compareTo方法，
	// 使GameScore类具有排序功能
	@Override
	public int compareTo(GameScore gScore) {
		// TODO Auto-generated method stub
		return -1 * Integer.valueOf(this.getPlascore().compareTo(gScore.getPlascore()));
	}

}
